import { getUserPages } from "@/api/users";
//import type { QueryCondition } from "@/api/users";
// 查询条件
export const queryCondition = ref({})
//export const queryCondition = ref({} as QueryCondition)

//查询结果
export const queriedResult = ref({})

//查询方法
export const queryUsers = async (params) => {
    Object.assign(queryCondition.value, params)
    const {data} =  await getUserPages(queryCondition.value)
    if(data.code === '000000'){
        queriedResult.value = data.data
        queriedResult.value.total = Number(queriedResult.value.total)
        console.log(queriedResult.value)
    } else {
        ElMessage.error('获取用户信息列表失败' +data.mesg)
        throw new Error('获取用户信息列表失败' +data.mesg)
    }
}
